/*
 * TaskThread.cpp
 *
 *  Created on: 15.12.2012
 *      Author: zheka
 */

#include "TaskThread.hpp"
#include "util/Log.hpp"
#include <signal.h>
void TaskThread::addTask(Task * task) {
//Log::v("[ThreadTask] try to add");
	dispatcher.addTask(task);
//	Log::v("[ThreadTask] added");
//	 condition.notify();
}

void TaskThread::run() {
	if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
			Log::v("Cant set signal ");
		}
	while (true) {
//		Log::v("[ThreadTask] try run");
		dispatcher.run();
//		Log::v("[ThreadTask] runned");
//	 	condition.wait();

	}
}
